<?php
    header("Content-Type: text/html;charset=utf-8");


    $mysqli = new mysqli("localhost","root","root","ibalian");

    if($mysqli->connect_errno != 0){
        die();
    };
    $brand = $_GET["brand"];
    $sql = "select * from category where brand = '{$brand}'";

    $res = $mysqli->query($sql);
    for ($i=0; $i < $res->num_rows; $i++) { 
        $data[] = $res->fetch_assoc();
    };


    print_r(json_encode($data));
?>